﻿<phone:PhoneApplicationPage 
    x:Class="Win7RovMobileApp.CheckingMenu"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:this="clr-namespace:Win7RovMobileApp"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d" d:DesignHeight="696" d:DesignWidth="480"
    shell:SystemTray.IsVisible="True">

    <UserControl.Resources>
        <Style x:Key="CounterStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="Padding" Value="1"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#9911e400" Offset="0"/>
                        <GradientStop Color="#00a0ff8c" Offset="0.2"/>
                        <GradientStop Color="#990c9d00" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>

        <Style x:Key="ColonStyle" TargetType="Border">
            <Setter Property="BorderBrush" Value="Black"/>
            <Setter Property="BorderThickness" Value="1"/>
            <Setter Property="Background">
                <Setter.Value>
                    <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                        <GradientStop Color="#f1965a" Offset="0"/>
                        <GradientStop Color="#fff073" Offset="0.2"/>
                        <GradientStop Color="#eb4200" Offset="1"/>
                    </LinearGradientBrush>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>

    <Grid>
        <Grid.Background>
            <ImageBrush ImageSource="/Win7RovMobileApp;component/Images/RoadBackground.png" Stretch="Fill" Opacity="0.8" />
        </Grid.Background>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="Auto"/>
        </Grid.RowDefinitions>

        <TextBlock Grid.Row="0" Text="Numarul de inmatriculare" Margin="20,70,20,1" FontSize="28" TextAlignment="Center" FontWeight="Bold" FontFamily="Tahoma">
            <TextBlock.Foreground>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#FF009000" Offset="0.506" />
                    <GradientStop Color="White" Offset="0" />
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>
        <TextBox Grid.Row="1" Margin="120,10" Name="CarPlateTextBox"/>
        
        <!-- Months and Days -->
        <Grid Grid.Row="2" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="20">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Luni" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="5" Foreground="Red" FontSize="22" FontWeight="Bold" />
            <Border Grid.Column="0" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter x:Name="Month1"/>
            </Border>
            <Border Grid.Column="1" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter x:Name="Month2"/>
            </Border>
            <Border Grid.Column="2" Grid.Row="1" Style="{StaticResource ColonStyle}">
                <TextBlock FontSize="24" FontWeight="Bold" Text=":" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Border>
            <TextBlock Grid.Column="3" Text="Zile" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5" Width="75" Grid.ColumnSpan="2" Foreground="Red" FontSize="22" FontWeight="Bold" />
            <Border Grid.Column="3" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter x:Name="Day1"/>
            </Border>
            <Border Grid.Column="4" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter x:Name="Day2"/>
            </Border>
        </Grid>

        <!-- Hours, Minutes and Seconds  -->
        <Grid Grid.Row="3" HorizontalAlignment="Center" VerticalAlignment="Center" >
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <TextBlock Grid.Row="0" Grid.Column="0" Text="Ore" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="5" Foreground="Red" FontSize="22" FontWeight="Bold" />
            <Border Grid.Column="0" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter  x:Name="Hour1"/>
            </Border>
            <Border Grid.Column="1" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter  x:Name="Hour2" />
            </Border>
            <TextBlock Grid.Row="0" Grid.Column="3" Text="Minute" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="5" Foreground="Red" FontSize="22" FontWeight="Bold" />
            <Border Grid.Column="2" Grid.Row="1" Style="{StaticResource ColonStyle}">
                <TextBlock FontSize="24" FontWeight="Bold" Text=":" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Border>
            <Border Grid.Column="3" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter x:Name="Minute1" />
            </Border>
            <Border Grid.Column="4" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter  x:Name="Minute2"/>
            </Border>
            <TextBlock Grid.Row="0" Grid.Column="6" Text="Secunde" TextAlignment="Center" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.ColumnSpan="2" Margin="5" Foreground="Red" FontSize="22" FontWeight="Bold" />
            <Border Grid.Column="5" Grid.Row="1" Style="{StaticResource ColonStyle}">
                <TextBlock FontSize="24" FontWeight="Bold" Text=":" HorizontalAlignment="Center" VerticalAlignment="Center"/>
            </Border>
            <Border Grid.Column="6" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter  x:Name="Second1"/>
            </Border>
            <Border Grid.Column="7" Grid.Row="1" Style="{StaticResource CounterStyle}">
                <this:TimeCounter  x:Name="Second2"/>
            </Border>
        </Grid>

        <!-- Alarm -->
        <Grid Grid.Row="4" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="30">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="Auto"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
                <ColumnDefinition Width="Auto"/>
            </Grid.ColumnDefinitions>
            <Image Grid.Row="0" Grid.Column="0" Margin="10" Source="/Win7RovMobileApp;component/Images/alarmBell.png" Name="AlarmImage" Height="40" MouseLeftButtonDown="SetAlarm_Click" Visibility="Collapsed"/>
            <TextBlock Grid.Row="0" Grid.Column="1" Margin="10" Name="AlarmTextBlock" Foreground="#FF008600" FontWeight="SemiBold" MouseLeftButtonDown="SetAlarm_Click" Visibility="Collapsed"/>
            <Image Grid.Row="1" Grid.Column="0" Margin="10" Source="/Win7RovMobileApp;component/Images/removeAlarmBell.png" Name="AlarmRemoveImage" Height="40" MouseLeftButtonDown="RemoveAlarm_Click" Visibility="Collapsed"/>
            <TextBlock Grid.Row="1" Grid.Column="1" Margin="10" Name="AlarmRemoveTextBlock" Foreground="#FFEB0000" FontWeight="SemiBold" MouseLeftButtonDown="RemoveAlarm_Click" Visibility="Collapsed"/>
        </Grid>

        <TextBlock Grid.Row="5" Name="ValabilityStartDate_TextBlock" HorizontalAlignment="Center" Text="Data intrarii in vigoare" FontFamily="Tahoma" FontSize="25" FontWeight="Bold">
            <TextBlock.Foreground>
                <LinearGradientBrush EndPoint="1,0.5" StartPoint="0,0.5">
                    <GradientStop Color="#FF009000" Offset="0.506" />
                    <GradientStop Color="White" Offset="0" />
                </LinearGradientBrush>
            </TextBlock.Foreground>
        </TextBlock>
        <TextBox Grid.Row="6" Margin="120,10" Name="ValabilityStartDate_TextBox"/>
    </Grid>
    
    <phone:PhoneApplicationPage.ApplicationBar>
        <shell:ApplicationBar IsVisible="True" IsMenuEnabled="True">
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/ApplicationBar.Check.png" Text="Verifica" Click="CheckCarPlates_Click" />
            <shell:ApplicationBarIconButton IconUri="/Toolkit.Content/ApplicationBar.Cancel.png" Text="Renunta" Click="CancelChecking_Click" />
        </shell:ApplicationBar>
    </phone:PhoneApplicationPage.ApplicationBar>

</phone:PhoneApplicationPage>
